/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.rh.game.loader;

import org.xml.sax.Attributes;

import org.xml.sax.helpers.DefaultHandler;

/**
 *
 * @author Hayden
 */
public class WorldHandler extends DefaultHandler {
    WorldBuffer wb = new WorldBuffer();
    WorldBuffer getWorldBuffer()  { return wb; }
    
    private static void debug(Object o)  {
        // System.out.println("WorldHandler: " + o);
    }
    
    public void characters(char[] ch, int start, int length)  {
        debug("char: " + String.copyValueOf(ch, start, length) + ", " + start + ", " + length);
        wb.characters(String.copyValueOf(ch, start, length));
    }
    
    public void endElement(String uri, String localName, String qName)  {
        debug(uri + ", " + localName + ", " + qName);
        wb.endElement(qName);
    }

    public void startElement(String uri, String localName, String qName, Attributes attributes)  {
        debug(uri + ", " + localName + ", " + qName);
        wb.startElement(qName);
    }
}
